﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using it_security_project.App_Code.BusinessLogicLayer;
using System.Data.SqlClient;
using System.Data;

namespace it_security_project.App_Code.DataAccessLayer
{
    public class LogDAL : DALBase
    {
        internal void AddLog(int userID, string action)
        {
            using (SqlConnection conn = CreateConnection())
            {
                SqlCommand cmd = new SqlCommand("dbo.usp_AddLog", conn);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.Add("@MemberID", SqlDbType.Int).Value = userID;
                cmd.Parameters.Add("@Action", SqlDbType.NVarChar, 500).Value = action;
                conn.Open();

                cmd.ExecuteNonQuery();
            }
        }
    }
}